home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 11 / FM Towns Free Software Collection 11.iso / t_os / tool / artemis1 / src / cmdexit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-08  |  968 b   |  64 lines

  1. /*
  2.     ARTemis (Graphic Editor for FM-TOWNS)
  3.     (c) MATSUUCHI Ryosuke 1992,1993,1994,1995
  4.  
  5.     cmdexit.c
  6. */
  7.  
  8.  
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <stdlib.h>
  12.  
  13. #include "ge.h"
  14. #include "dispman.h"
  15.  
  16. /*
  17. #define    itemDoExit    1
  18. #define    itemCancel    2
  19. */
  20.  
  21. #include "cmdexit.md"
  22.  
  23. int commandExit()
  24. {
  25.     int f_exit = 0;
  26.     menu_disp(&exitmenu);
  27.     for (;;)
  28.     {
  29.         DMdispcsr(ms.x,ms.y);
  30.         do
  31.         {
  32.             ms_get(&ms);
  33.         } while (ms.dx==0 && ms.dy==0 && ms.btn1==OFF && ms.btn2==OFF &&
  34.                  key_chk()==0);
  35.         DMerasecsr();
  36.         scrollForCsr(1,1);
  37.         if (ms.btn1 == OFFON)
  38.         {
  39.             int a;
  40.             a = menu_where(ms.x,ms.y,&exitmenu, NULL,NULL,NULL);
  41.             if (a == itemDoExit)
  42.                 break;
  43.             else if (a == itemCancel)
  44.             {
  45.                 f_exit = -1;
  46.                 break;
  47.             }
  48.             else if (a == itemMoveMenu)
  49.             {
  50.                 menu_move();
  51.             }
  52.         }
  53.         else if (ms.btn2 == OFFON)
  54.         {
  55.             f_exit = -1;
  56.             break;
  57.         }
  58.     }
  59.     menu_erase();
  60.     return f_exit;
  61. }
  62.  
  63. /* end of cmdexit.c */
  64.